

let {compose} = require('ramda');

let IO = function (f) {
    this.unsafePerformIO = f;
};

IO.of = function (x) {
    return new IO(function () {
        return x;
    })
};


// prototype
IO.prototype.map = function(f){
    return new IO(compose(f,this.unsafePerformIO))
};


module.exports = IO;
